// pages/invoice-detail/invoice-detail.js
Page({
  data: {
    invoiceInfo: {},
    hospitalInfo: {
      name: '惠仁医院',
      receiptCode: '34568900',
      receiptNumber: '900787890091'
    }
  },

  onLoad: function(options) {
    // 接收发票信息
    this.setData({
      invoiceInfo: {
        id: options.invoiceId,
        date: options.date,
        department: options.department,
        amount: options.amount,
        invoiceNumber: options.invoiceNumber,
        payer: options.payer
      }
    });
  },

  // 查看电子发票
  viewElectronicInvoice: function() {
    wx.navigateTo({
      url: `/pages/view-invoice/view-invoice?invoiceId=${this.data.invoiceInfo.id}&type=门诊费用&amount=${this.data.invoiceInfo.amount}&date=${this.data.invoiceInfo.date}&department=${this.data.invoiceInfo.department}&doctor=张医生`
    });
  }
});

